package com.linln.modules.member.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import com.linln.modules.member.domain.AreaCount;

/**
 * @author hct
 * @date 2019/09/12
 */
public interface AreaCountRepository extends JpaRepository<AreaCount, Long> {
	
	public AreaCount findByArea(String area);
	
	
    @Modifying
    @Transactional
    @Query("update AreaCount set message_readnum =message_readnum+1  where area = ?1 ")
	public int updateReadNumByArea(String area);
	
    @Modifying
    @Transactional
    @Query("update AreaCount set message_fabunum =message_fabunum+1  where area = ?1 ")
	public int updateFabuByArea(String area);
	
    
    @Modifying
    @Transactional
    @Query("update AreaCount set message_sharenum =message_sharenum+1  where area = ?1 ")
	public int updateShareByArea(String area);
	
    
    @Modifying
    @Transactional
    @Query("update AreaCount set message_collectnum =message_collectnum+1  where area = ?1 ")
	public int updateCollectByArea(String area);
	
    
    @Modifying
    @Transactional
    @Query("update AreaCount set store_fabunum =store_fabunum+1  where area = ?1 ")
	public int updateStoreFabuByArea(String area);
	
    @Modifying
    @Transactional
    @Query("update AreaCount set store_readnum =store_readnum+1  where area = ?1 ")
	public int updateStoreReadByArea(String area);
	
    @Modifying
    @Transactional
    @Query("update AreaCount set store_sharenum =store_sharenum+1  where area = ?1 ")
	public int updateStoreShareByArea(String area);
	
    
    @Modifying
    @Transactional
    @Query("update AreaCount set store_collectnum =store_collectnum+1  where area = ?1 ")
	public int updateStoreCollectByArea(String area);
	
	
}